/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Pouet.java
 *
 * Created on May 5, 2011, 9:16:24 AM
 */

package raytracergui;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
import javax.swing.JFileChooser;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileNameExtensionFilter;


public class Pouet extends javax.swing.JPanel {
    Application par;

    /** Creates new form Pouet */
    public Pouet(Application par) {
        this.par = par;
        initComponents();
    }

    

    public String getNomProgramme(){
        String programme;
        String osName = "Windows";

        try{
            osName = System.getProperty("os.name");
        }catch (Exception e){
            System.out.println("Exception="+e.getMessage());
            osName = "Windows";
        }

        osName.toUpperCase();
        if(osName.contains("WINDOWS")){
            programme = "Raytracer.exe";
            return getJarFolder(true)+programme;
        }
        else{
            programme = "Raytracer";
            return getJarFolder(false)+programme;
        }
    }
    @SuppressWarnings("unchecked")

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jTX = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jTY = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jTZ = new javax.swing.JTextField();
        jProgressBar1 = new javax.swing.JProgressBar();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jTRadius = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTHautX = new javax.swing.JTextField();
        jTHautY = new javax.swing.JTextField();
        jTHautZ = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jTMatR = new javax.swing.JTextField();
        jTMatG = new javax.swing.JTextField();
        jTMatB = new javax.swing.JTextField();
        jTMatDiffu = new javax.swing.JTextField();
        jTMatRefl = new javax.swing.JTextField();
        jTMatSpec = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jTColR = new javax.swing.JTextField();
        jTColB = new javax.swing.JTextField();
        jTColG = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jTImgX = new javax.swing.JTextField();
        jTImgZ = new javax.swing.JTextField();
        jTFact = new javax.swing.JTextField();
        jTImgY = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jTMatDiffr = new javax.swing.JTextField();

        setPreferredSize(new java.awt.Dimension(800, 600));

        jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                jList1ValueChanged(evt);
            }
        });
        jScrollPane1.setViewportView(jList1);

        jTX.setText("0");
        jTX.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTXFocusLost(evt);
            }
        });

        jLabel1.setText("X");

        jLabel2.setText("Y");

        jTY.setText("0");
        jTY.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTYActionPerformed(evt);
            }
        });
        jTY.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTYFocusLost(evt);
            }
        });

        jLabel3.setText("Z");

        jTZ.setText("0");
        jTZ.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTZActionPerformed(evt);
            }
        });
        jTZ.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTZFocusLost(evt);
            }
        });

        jButton1.setText("Générer Image");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Sphère");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Plan");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("Lumière");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel4.setText("Radius");

        jTRadius.setText("0");
        jTRadius.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTRadiusFocusLost(evt);
            }
        });

        jLabel5.setText("Haut");

        jTHautX.setText("0");
        jTHautX.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTHautXFocusLost(evt);
            }
        });

        jTHautY.setText("0");
        jTHautY.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTHautYFocusLost(evt);
            }
        });

        jTHautZ.setText("0");
        jTHautZ.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTHautZFocusLost(evt);
            }
        });

        jLabel6.setText("Matériel");

        jTMatR.setText("0");
        jTMatR.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatRFocusLost(evt);
            }
        });

        jTMatG.setText("0");
        jTMatG.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatGFocusLost(evt);
            }
        });

        jTMatB.setText("0");
        jTMatB.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatBFocusLost(evt);
            }
        });

        jTMatDiffu.setText("0");
        jTMatDiffu.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatDiffuFocusLost(evt);
            }
        });

        jTMatRefl.setText("0");
        jTMatRefl.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatReflFocusLost(evt);
            }
        });

        jTMatSpec.setText("0");
        jTMatSpec.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatSpecFocusLost(evt);
            }
        });

        jLabel7.setText("Couleur");

        jTColR.setText("0");
        jTColR.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTColRFocusLost(evt);
            }
        });

        jTColB.setText("0");
        jTColB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTColBActionPerformed(evt);
            }
        });
        jTColB.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTColBFocusLost(evt);
            }
        });

        jTColG.setText("0");
        jTColG.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTColGActionPerformed(evt);
            }
        });
        jTColG.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTColGFocusLost(evt);
            }
        });

        jLabel8.setText("Taille Image");

        jLabel9.setText("Profondeur Image");

        jLabel10.setText("Facteur");

        jTImgX.setText("0");
        jTImgX.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTImgXFocusLost(evt);
            }
        });

        jTImgZ.setText("0");
        jTImgZ.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTImgZFocusLost(evt);
            }
        });

        jTFact.setText("0");
        jTFact.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTFactFocusLost(evt);
            }
        });

        jTImgY.setText("0");
        jTImgY.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTImgYFocusLost(evt);
            }
        });

        jLabel11.setText("X");

        jButton5.setText("Supprimer");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jTMatDiffr.setText("0");
        jTMatDiffr.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTMatDiffrActionPerformed(evt);
            }
        });
        jTMatDiffr.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTMatDiffrFocusLost(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(136, 136, 136)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel8)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10)
                            .addComponent(jLabel2)
                            .addComponent(jLabel4)
                            .addComponent(jLabel1)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jTImgX, 0, 0, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jTFact, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTImgZ, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTMatR, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTColR, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTHautX, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTRadius, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTX, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                                .addComponent(jTY, 0, 0, Short.MAX_VALUE)
                                .addComponent(jTZ, javax.swing.GroupLayout.DEFAULT_SIZE, 43, Short.MAX_VALUE)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(18, 18, 18)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jTHautY, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
                                            .addComponent(jTMatB, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
                                            .addComponent(jTColG, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel11)
                                        .addGap(15, 15, 15)))
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(31, 31, 31)
                                        .addComponent(jTImgY, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jTHautZ, javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jTMatDiffu, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                            .addComponent(jTColB, javax.swing.GroupLayout.Alignment.LEADING))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTMatG, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(16, 16, 16)
                                        .addComponent(jTMatRefl, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTMatSpec, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jTMatDiffr, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 105, Short.MAX_VALUE)
                                        .addComponent(jButton4))
                                    .addComponent(jButton5, javax.swing.GroupLayout.Alignment.TRAILING)))
                            .addGroup(layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTZ, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTY, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTX, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(jButton2))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel4)
                                    .addComponent(jTRadius, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel5)
                                    .addComponent(jTHautX, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTHautY, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTHautZ, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel6)
                                    .addComponent(jTMatR, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatG, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatB, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatDiffu, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatDiffr, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatSpec, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jTMatRefl, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jButton3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jTColR, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTColG, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTColB, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel8)
                                    .addComponent(jButton4)
                                    .addComponent(jTImgX, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel11))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel9)
                                    .addComponent(jTImgZ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jButton5))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel10)
                                    .addComponent(jTFact, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 201, Short.MAX_VALUE)
                                .addComponent(jButton1))
                            .addComponent(jTImgY, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(30, 30, 30))))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        String nom = "sphere"+par.getArObjets().size();
        Sphere sphere = new Sphere(nom);
        par.getArObjets().add(sphere);
        setList(par.getArObjets(),par.getArLights());
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        String nom = "light"+par.getArLights().size();
        Light light = new Light(nom);
        par.getArLights().add(light);
        setList(par.getArObjets(),par.getArLights());
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jTYActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTYActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTYActionPerformed

    private void jTZActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTZActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTZActionPerformed


    private String getConfigFile(){
        String cheminFichier = null;
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter(
            "Fichiers .ini", "ini");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showOpenDialog(null);
        if(returnVal == JFileChooser.APPROVE_OPTION) {
           cheminFichier = chooser.getSelectedFile().getAbsolutePath();
           return cheminFichier;
        }
        return "";
    }

      private String getJarFolder(boolean windows) {
        String name = this.getClass().getName().replace('.', '/');
        String s = this.getClass().getResource("/" + name + ".class").toString();
        s = s.replace('/', File.separatorChar);
        s = s.substring(0, s.indexOf(".jar")+4);
        s = s.substring(s.lastIndexOf(':')-1);
        if(windows)
            return s.substring(0, s.lastIndexOf(File.separatorChar)+1);
        else
            return s.substring(2, s.lastIndexOf(File.separatorChar)+1);
      }


    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        Process p = null;
        byte bPourcent = 0;
        BufferedInputStream stdout = null;
        try {
            p = Runtime.getRuntime().exec(new String[] {getNomProgramme(),getConfigFile(),"-c"});

            stdout = new BufferedInputStream(p.getInputStream());

            while(true){
                bPourcent =  (byte) stdout.read();
                if(bPourcent != -1){
                 setProgressBarValeur((int)bPourcent);
                 this.repaint();
                 if((int)bPourcent == 100){
                    setProgressBarValeur(0);
                    this.repaint();
                    JOptionPane.showMessageDialog(this, "L'image a été générée avec succès!");
                    break;
                 }
                }
            }

        } catch (IOException ex) {
            JOptionPane.showMessageDialog(this, "Impossible de trouver le programme.\n" +
                    "Vérifier que le programme " + getNomProgramme() + " est accessible");
            Logger.getLogger(Application.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        String nom = "plane"+par.getArObjets().size();
        Plane plane = new Plane(nom);
        par.getArObjets().add(plane);
        setList(par.getArObjets(),par.getArLights());
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere || obj instanceof Plane){
            par.getArObjets().remove(obj);
        }else
        if(obj instanceof Light){
            par.getArLights().remove(obj);
        }
        setList(par.getArObjets(),par.getArLights());
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jTMatDiffrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTMatDiffrActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTMatDiffrActionPerformed

    private void jTColGActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTColGActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTColGActionPerformed

    private void jTColBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTColBActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTColBActionPerformed

    private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged
        //call uptateGUI
        par.UpdateGUI();
        System.out.println(this.jList1.getSelectedValue());
    }//GEN-LAST:event_jList1ValueChanged

    private void jTXFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTXFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setPosX(this.getjTX());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setPosX(this.getjTX());
        }else
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setPosX(this.getjTX());
        }
    }//GEN-LAST:event_jTXFocusLost

    private void jTYFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTYFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setPosY(this.getjTY());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setPosY(this.getjTY());
        }else
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setPosY(this.getjTY());
        }
    }//GEN-LAST:event_jTYFocusLost

    private void jTZFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTZFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setPosZ(this.getjTZ());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setPosZ(this.getjTZ());
        }else
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setPosZ(this.getjTZ());
        }
    }//GEN-LAST:event_jTZFocusLost

    private void jTRadiusFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTRadiusFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setRadius(this.getjTRadius());
        }
    }//GEN-LAST:event_jTRadiusFocusLost

    private void jTHautXFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTHautXFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setUpX(this.getjTHautX());
        }
    }//GEN-LAST:event_jTHautXFocusLost

    private void jTHautYFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTHautYFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setUpY(this.getjTHautY());
        }
    }//GEN-LAST:event_jTHautYFocusLost

    private void jTHautZFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTHautZFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setUpZ(this.getjTHautZ());
        }
    }//GEN-LAST:event_jTHautZFocusLost

    private void jTMatRFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatRFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatR(this.getjTMatR());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatR(this.getjTMatR());
        }
    }//GEN-LAST:event_jTMatRFocusLost

    private void jTMatBFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatBFocusLost
       Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatB(this.getjTMatB());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatB(this.getjTMatB());
        }
    }//GEN-LAST:event_jTMatBFocusLost

    private void jTMatDiffuFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatDiffuFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatDiffuse(this.getjTMatDiffu());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatDiffuse(this.getjTMatDiffu());
        }
    }//GEN-LAST:event_jTMatDiffuFocusLost

    private void jTMatReflFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatReflFocusLost
       Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatReflective(this.getjTMatRefl());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatReflective(this.getjTMatRefl());
        }
    }//GEN-LAST:event_jTMatReflFocusLost

    private void jTMatSpecFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatSpecFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatSpecular(this.getjTMatSpec());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatSpecular(this.getjTMatSpec());
        }
    }//GEN-LAST:event_jTMatSpecFocusLost

    private void jTMatDiffrFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatDiffrFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatDiffraction(this.getjTMatDiffr());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatDiffraction(this.getjTMatDiffr());
        }
    }//GEN-LAST:event_jTMatDiffrFocusLost

    private void jTColRFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTColRFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setCouleurR(this.getjTColR());
        }
    }//GEN-LAST:event_jTColRFocusLost

    private void jTColGFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTColGFocusLost
       Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setCouleurG(this.getjTColG());
        }
    }//GEN-LAST:event_jTColGFocusLost

    private void jTColBFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTColBFocusLost
       Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Light){
            Light l = (Light) obj;
            l.setCouleurB(this.getjTColB());
        }
    }//GEN-LAST:event_jTColBFocusLost

    private void jTImgXFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTImgXFocusLost
        Image img = (Image) this.jList1.getSelectedValue();
        img.setSizeX(this.getjTImgX());
    }//GEN-LAST:event_jTImgXFocusLost

    private void jTImgYFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTImgYFocusLost
        Image img = (Image) this.jList1.getSelectedValue();
        img.setSizeY(this.getjTImgY());
    }//GEN-LAST:event_jTImgYFocusLost

    private void jTImgZFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTImgZFocusLost
        Image img = (Image) this.jList1.getSelectedValue();
        img.setDepth(this.getjTImgZ());
    }//GEN-LAST:event_jTImgZFocusLost

    private void jTFactFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTFactFocusLost
        Image img = (Image) this.jList1.getSelectedValue();
        img.setFactor(this.getjTFact());
    }//GEN-LAST:event_jTFactFocusLost

    private void jTMatGFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTMatGFocusLost
        Object obj = this.jList1.getSelectedValue();
        if(obj instanceof Sphere){
            Sphere s = (Sphere) obj;
            s.setMatG(this.getjTMatG());
        }else
        if(obj instanceof Plane){
            Plane p = (Plane) obj;
            p.setMatG(this.getjTMatG());
        }
    }//GEN-LAST:event_jTMatGFocusLost


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTColB;
    private javax.swing.JTextField jTColG;
    private javax.swing.JTextField jTColR;
    private javax.swing.JTextField jTFact;
    private javax.swing.JTextField jTHautX;
    private javax.swing.JTextField jTHautY;
    private javax.swing.JTextField jTHautZ;
    private javax.swing.JTextField jTImgX;
    private javax.swing.JTextField jTImgY;
    private javax.swing.JTextField jTImgZ;
    private javax.swing.JTextField jTMatB;
    private javax.swing.JTextField jTMatDiffr;
    private javax.swing.JTextField jTMatDiffu;
    private javax.swing.JTextField jTMatG;
    private javax.swing.JTextField jTMatR;
    private javax.swing.JTextField jTMatRefl;
    private javax.swing.JTextField jTMatSpec;
    private javax.swing.JTextField jTRadius;
    private javax.swing.JTextField jTX;
    private javax.swing.JTextField jTY;
    private javax.swing.JTextField jTZ;
    // End of variables declaration//GEN-END:variables

    public void setProgressBarValeur(int valeur){
        this.jProgressBar1.setValue(valeur);
    }


    public String getjTFact() {
        return jTFact.getText();
    }

    public void setjTFact(String string) {
        this.jTFact.setText(string);
    }

    public String getjTHautX() {
        return jTHautX.getText();
    }

    public void setjTHautX(String string) {
        this.jTHautX.setText(string);
    }

    public String getjTHautY() {
        return jTHautY.getText();
    }

    public void setjTHautY(String string) {
        this.jTHautY.setText(string);
    }

    public String getjTHautZ() {
        return jTHautZ.getText();
    }

    public void setjTHautZ(String string) {
        this.jTHautZ.setText(string);
    }

    public String getjTImgX() {
        return jTImgX.getText();
    }

    public void setjTImgX(String string) {
        this.jTImgX.setText(string);
    }

    public String getjTImgY() {
        return jTImgY.getText();
    }

    public void setjTImgY(String string) {
        this.jTImgY.setText(string);
    }

    public String getjTImgZ() {
        return jTImgZ.getText();
    }

    public void setjTImgZ(String string) {
        this.jTImgZ.setText(string);
    }

    public String getjTMatB() {
        return jTMatB.getText();
    }

    public void setjTMatB(String string) {
        this.jTMatB.setText(string);
    }

    public String getjTMatDiffr() {
        return jTMatDiffr.getText();
    }

    public void setjTMatDiffr(String string) {
        this.jTMatDiffr.setText(string);
    }

    public String getjTMatDiffu() {
        return jTMatDiffu.getText();
    }

    public void setjTMatDiffu(String string) {
        this.jTMatDiffu.setText(string);
    }

    public String getjTMatG() {
        return jTMatG.getText();
    }

    public void setjTMatG(String string) {
        this.jTMatG.setText(string);
    }

    public String getjTMatR() {
        return jTMatR.getText();
    }

    public void setjTMatR(String string) {
        this.jTMatR.setText(string);
    }

    public String getjTMatRefl() {
        return jTMatRefl.getText();
    }

    public void setjTMatRefl(String string) {
        this.jTMatRefl.setText(string);
    }

    public String getjTMatSpec() {
        return jTMatSpec.getText();
    }

    public void setjTMatSpec(String string) {
        this.jTMatSpec.setText(string);
    }

    public String getjTRadius() {
        return jTRadius.getText();
    }

    public void setjTRadius(String string) {
        this.jTRadius.setText(string);
    }

    public String getjTX() {
        return jTX.getText();
    }

    public void setjTX(String string) {
        this.jTX.setText(string);
    }

    public String getjTY() {
        return jTY.getText();
    }

    public void setjTY(String string) {
        this.jTY.setText(string);
    }

    public String getjTZ() {
        return jTZ.getText();
    }

    public void setjTZ(String string) {
        this.jTZ.setText(string);
    }

    public String getjTColB() {
        return jTColB.getText();
    }

    public void setjTColB(String string) {
        this.jTColB.setText(string);
    }

    public String getjTColG() {
        return jTColG.getText();
    }

    public void setjTColG(String string) {
        this.jTColG.setText(string);
    }

    public String getjTColR() {
        return jTColR.getText();
    }

    public void setjTColR(String string) {
        this.jTColR.setText(string);
    }

    public JList getjList() {
        return jList1;
    }


    public void setList(ArrayList arObjs, ArrayList arLights){
        int j,i;
        DefaultListModel model = new DefaultListModel();
        this.jList1.setModel(model);

        for(j=0;j<arObjs.size();j++){
            model.add(j,arObjs.get(j));
        }

        for(i=0;i<arLights.size();i++){
            model.add(i+j,arLights.get(i));
        }


    }

    public void VisAll(boolean b){
        VisjTFact(b);
        VisjTHautX(b);
        VisjTHautY(b);
        VisjTHautZ(b);
        VisjTImgX(b);
        VisjTImgY(b);
        VisjTImgZ(b);
        VisjTMatB(b);
        VisjTMatDiffr(b);
        VisjTMatDiffu(b);
        VisjTMatG(b);
        VisjTMatR(b);
        VisjTMatRefl(b);
        VisjTMatSpec(b);
        VisjTRadius(b);
        VisjTX(b);
        VisjTY(b);
        VisjTZ(b);
        VisjTColB(b);
        VisjTColG(b);
        VisjTColR(b);
    }

    public void VisjTFact(boolean b){
        this.jTFact.setEnabled(b);
        if(b == false){
            this.jTFact.setText("0");
        }
    }

    public void VisjTHautX(boolean b){
        this.jTHautX.setEnabled(b);
        if(b == false){
            this.jTHautX.setText("0");
        }
    }

    public void VisjTHautY(boolean b){
        this.jTHautY.setEnabled(b);
        if(b == false){
            this.jTHautY.setText("0");
        }
    }

    public void VisjTHautZ(boolean b){
        this.jTHautZ.setEnabled(b);
        if(b == false){
            this.jTHautZ.setText("0");
        }
    }

    public void VisjTImgX(boolean b){
        this.jTImgX.setEnabled(b);
        if(b == false){
            this.jTImgX.setText("0");
        }
    }

    public void VisjTImgY(boolean b){
        this.jTImgY.setEnabled(b);
        if(b == false){
            this.jTImgY.setText("0");
        }
    }

    public void VisjTImgZ(boolean b){
        this.jTImgZ.setEnabled(b);
        if(b == false){
            this.jTImgZ.setText("0");
        }
    }

    public void VisjTMatB(boolean b){
        this.jTMatB.setEnabled(b);
        if(b == false){
            this.jTMatB.setText("0");
        }
    }

    public void VisjTMatDiffr(boolean b){
        this.jTMatDiffr.setEnabled(b);
        if(b == false){
            this.jTMatDiffr.setText("0");
        }
    }

    public void VisjTMatDiffu(boolean b){
        this.jTMatDiffu.setEnabled(b);
        if(b == false){
            this.jTMatDiffu.setText("0");
        }
    }

    public void VisjTMatG(boolean b){
        this.jTMatG.setEnabled(b);
        if(b == false){
            this.jTMatG.setText("0");
        }
    }

    public void VisjTMatR(boolean b){
        this.jTMatR.setEnabled(b);
        if(b == false){
            this.jTMatR.setText("0");
        }
    }

    public void VisjTMatRefl(boolean b){
        this.jTMatRefl.setEnabled(b);
        if(b == false){
            this.jTMatRefl.setText("0");
        }
    }

    public void VisjTMatSpec(boolean b){
        this.jTMatSpec.setEnabled(b);
        if(b == false){
            this.jTMatSpec.setText("0");
        }
    }

    public void VisjTRadius(boolean b){
        this.jTRadius.setEnabled(b);
        if(b == false){
            this.jTRadius.setText("0");
        }
    }

    public void VisjTX(boolean b){
        this.jTX.setEnabled(b);
        if(b == false){
            this.jTX.setText("0");
        }
    }

    public void VisjTY(boolean b){
        this.jTY.setEnabled(b);
        if(b == false){
            this.jTY.setText("0");
        }
    }

    public void VisjTZ(boolean b){
        this.jTZ.setEnabled(b);
        if(b == false){
            this.jTZ.setText("0");
        }
    }

    public void VisjTColB(boolean b){
        this.jTColB.setEnabled(b);
        if(b == false){
            this.jTColB.setText("0");
        }
    }

    public void VisjTColG(boolean b){
        this.jTColG.setEnabled(b);
        if(b == false){
            this.jTColG.setText("0");
        }
    }

    public void VisjTColR(boolean b){
        this.jTColR.setEnabled(b);
        if(b == false){
            this.jTColR.setText("0");
        }
    }

}
